﻿using System.Data.Entity.ModelConfiguration;

namespace HobSoft.SoccerBet2014.Domain.Models.DbSchema
{
    public class BFEventConfiguration : EntityTypeConfiguration<BFEvent>
    {
        public BFEventConfiguration(string schema = "dbo")
        {
            ToTable(schema + ".BFEvent");
            HasKey(be => be.EventID);
            Property(be => be.EventID).HasColumnName("EventID").IsRequired();
            Property(be => be.EventPath).HasColumnName("EventPath").IsRequired().HasMaxLength(500);
            Property(be => be.HomeTeam).HasColumnName("HTeam").IsRequired().HasMaxLength(100);
            Property(be => be.AwayTeam).HasColumnName("VTeam").IsRequired().HasMaxLength(100);
            Property(be => be.StartTime).HasColumnName("EventTime").IsRequired();
            Property(be => be.HomeScore).HasColumnName("HScore").IsOptional();
            Property(be => be.AwayScore).HasColumnName("VScore").IsOptional();
            Property(be => be.Tournament).HasColumnName("LeagueName").IsRequired().HasMaxLength(50);
            Property(be => be.TournamentFullName).HasColumnName("LeagueFullName").IsOptional().HasMaxLength(200);
            Property(be => be.OrderIndex).HasColumnName("OrderIndex").IsRequired();
            Property(be => be.State).HasColumnName("EventStatus").IsRequired().HasMaxLength(20).IsUnicode(false);
            Property(be => be.DisplayTime).HasColumnName("MatchTime").IsOptional().HasMaxLength(50).IsUnicode(false);
            Property(be => be.NotAvailable).HasColumnName("Disable").IsOptional();
        }
    }
}
